﻿// 2012 lukbrasil
// Visual C# 2008 How to Program - Exercise 4.12

public class Invoice {
  private string number;
  private string description;
  private int quantity;
  private decimal price;

  public Invoice(string itemNumber, string itemDescription, int itemQuantity, decimal itemPrice) {   
    number = itemNumber;
    description = itemDescription;
    Quantity = itemQuantity;
    PricePerItem = itemPrice;
  }

  public int Quantity {
    get {
      return quantity;    
    }

    set {
      if (value >= 0) {
        quantity = value;
      }
    }
  }

  public decimal PricePerItem {
    get {
      return price;
    }

    set {
      if (value >= 0) {
        price = value;
      }
    }
  }

  public string Number {
    get {    
      return number;
    }
  }
  
  public string Description {
    get {
      return description;
    }
  }

  public decimal Amount() {
    return Quantity * PricePerItem;    
  }
}